package ar.com.fiuba.ElectronicCircuitAnalyst.application.api.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * Data transfer object for Circuit class. It holds:
 * 
 * @param name
 *            the name for the circuit.
 * 
 * @param inputsCount
 *            number of inputs for the circuit.
 * @param outputsCount
 *            number of outputs for the circuit.
 * @param componentsNames
 *            names of the components to use inside the circuit.
 * @param connections
 *            the connections through the circuit components.
 * 
 */
public class CircuitDto {

	private String name = "";

	private Integer inputsCount = -1;

	private Integer outputsCount = -1;

	private List<String> componentsNames = new ArrayList<String>();

	private List<ConnectionDto> connections = new ArrayList<ConnectionDto>();
	
	public CircuitDto() {
	}

	public CircuitDto(String name, Integer inputsCount, Integer outputsCount, List<String> componentsNames,
			List<ConnectionDto> connections) {
		this.name = name;
		this.inputsCount = inputsCount;
		this.outputsCount = outputsCount;
		this.componentsNames = componentsNames;
		this.connections = connections;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getInputsCount() {
		return inputsCount;
	}

	public void setInputsCount(Integer inputsCount) {
		this.inputsCount = inputsCount;
	}

	public Integer getOutputsCount() {
		return outputsCount;
	}

	public void setOutputsCount(Integer outputsCount) {
		this.outputsCount = outputsCount;
	}

	public List<String> getComponentsNames() {
		return componentsNames;
	}

	public void setComponentsNames(List<String> componentsNames) {
		this.componentsNames = componentsNames;
	}

	public void addComponent(String name) {
		this.componentsNames.add(name);
	}

	public List<ConnectionDto> getConnections() {
		return connections;
	}

	public void setConnections(List<ConnectionDto> connections) {
		this.connections = connections;
	}

	public void addConnection(ConnectionDto connection) {
		this.connections.add(connection);
	}

}
